<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>DASHMIN - Bootstrap Admin Template</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta content="" name="keywords">
    <meta content="" name="description">
    <title>表单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
    <link href="css/css2.css" rel="stylesheet">
    <link href="css/all.min.css" rel="stylesheet">
    <link href="css/bootstrap-icons.css" rel="stylesheet">
    <link href="css/owl.carousel.min.css" rel="stylesheet">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

</head>
<style>
    .layui-form-label{
        width: 100px;
        margin-left: -37px;
    }
    #messageBox {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background-color: #53af4c;
        border: 1px solid #4cafac;
        padding: 20px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        text-align: center;
    }
</style>
<body>
<script>

</script>
<div class="container-fluid position-relative bg-white d-flex p-0">
    <div class="sidebar pe-4 pb-3">
        <nav class="navbar bg-light navbar-light">
            <a href="leave?action=list" class="navbar-brand mx-4 mb-3">
                <h3 class="text-primary">网上请假系统</h3>
            </a>

            <div class="navbar-nav w-100">
                <a href="leave?action=list" class="nav-item nav-link">请假申请</a>
                <a href="leave?action=LeaveID" class="nav-item nav-link active">填写请假申请</a>
            </div>
        </nav>
    </div>


    <div class="content">

        <nav class="navbar navbar-expand bg-light navbar-light px-4 py-0" style="height: 48px;">
                <div class="d-none d-md-flex ms-4">
                    <input style="margin-top: 21px;width: 960px;background-color: #f0f0f0;" class="form-control border-0" >
                </div>
            <div class="navbar-nav align-items-center ms-auto" style="">
                <div class="nav-item dropdown">
                    <a href="login.jsp" class="btn btn-outline-danger" style="margin-top: 17px; width: 65px; margin-left: 1000px; display: inline-block;">退出</a>
                    <input type="hidden" name="action" value=".../login.jsp">
                </div>
            </div>
        </nav>

        <div class="shadow-sm p-3 mb-5 bg-white rounded">
            <div class="container-fluid pt-4 px-4" style="background-color: #efefef;">
                <div class="bg-light text-center rounded p-4" style="height: 630px !important;">
                <div style="margin: 15px;">
                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                        <legend>请假单</legend>
                    </fieldset>
                    <form class="layui-form" action="leave" id="myForm">
                        <div class="layui-form-item">
                            <label class="layui-form-label">请假单号</label>
                            <div class="layui-input-inline" style="width: 240px">
                                <input type="text" name="leaveID" id="leaveID" autocomplete="off" class="layui-input" value=${leaveID}>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">学号</label>
                            <div class="layui-input-inline" style="width: 240px">
                                <input type="text" name="stuNo"  id="stuNo" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">请假课程</label>
                                <select name="courseID"  id="courseID" lay-filter="aihao"
                                        style="display: inline;width: 240px;height: 42px;border-color: #eee;" class="layui-input-inline">
                                    <option value="" selected="">请选择课程</option>
                                    <c:forEach var="course" items="${course}">
                                        <option value="${course.courseID}">${course.courseName}</option>
                                    </c:forEach>
                                </select>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">请假天数</label>
                            <div class="layui-input-inline" style="width: 240px">
                                <input type="text" name="dayNum" id="dayNum" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">请假事由</label>
                            <div class="layui-input-block" >
                                <textarea placeholder="请输入内容" name="reason" id="reason" class="layui-textarea" style="margin-left: -47px;"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                                <a type="reset" class="layui-btn layui-btn-primary" href="leave?action=LeaveID">重置</a>
                            </div>
                        </div>
                        <input type="hidden" id="applyTime" name="applyTime">
                        <input type="hidden" name="action" value="add">
                    </form>
                </div>
            </div>
        </div>
        </div>
    </div>
</div>
<div id="messageBox"></div>
<script type="text/javascript">
    window.onload = function() {
        var errorMessage = "${errorMessage}";
        var successMessage = "${successMessage}";
        var messageBox = document.getElementById('messageBox');

        if (errorMessage) {
            messageBox.textContent = errorMessage;
            messageBox.style.display = 'block';
            setTimeout(function() {
                messageBox.style.display = 'none';
            }, 2000);
        } else if (successMessage) {
            messageBox.textContent = successMessage;
            messageBox.style.display = 'block';
            setTimeout(function() {
                messageBox.style.display = 'none';
            }, 2000);
        }
    };

</script>
        <script type="text/javascript" src="plugins/layui/layui.js"></script>
        <script src="js/jquery-3.4.1.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
        <script src="js/bootstrap.bundle.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
        <script src="js/chart.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
        <script src="js/easing.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
        <script src="js/waypoints.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
        <script src="js/owl.carousel.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
        <script src="js/moment.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
        <script src="js/moment-timezone.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
        <script src="js/tempusdominus-bootstrap-4.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
        <script src="js/main.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
        <script src="js/rocket-loader.min.js" data-cf-settings="4bebc94b2db97a1f9680a39f-|49" defer=""></script>
</body>
</html>